<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>产品详情</title>
<link rel="stylesheet" type="text/css" href="../css/aui.css">
<link rel="stylesheet" type="text/css" href="../css/aui-slide.css">
<link rel="stylesheet" type="text/css" href="../css/aui-flex.css">
<link rel="stylesheet" type="text/css" href="../css/my.css">
<link rel="stylesheet" type="text/css" href="../css/index.css">
<link rel="stylesheet" type="text/css" href="../css/common.css">
</head>
<style type="text/css">
  .back{position: fixed;top: 1.5rem;left: 1rem;width: 1.5rem;height: 1.5rem;background: #000;z-index: 9999;color: #fff;line-height: 1.5rem;opacity: .5;text-align: center;border-radius: 50%;}
  #desc img{max-width: 100% !important;width: auto !important;}
  .aui-slide-page-active{background: #fff;width: .8rem;border-radius: 3px;}
  #guess_list img{/*height: 45vw;*/width: 100%;}
  .tb_zt_texttit{
    font-size: 0.8rem;letter-spacing:0.02rem;
  }
  .tb_zt_top{
    margin-top: 5px;
  }
  .tb_price{
    float:left;
    text-align: end;color: #FF175D;
  }
  .tb_price .priceH{
    padding:3px 0rem;text-decoration:none;border-radius: 5px;margin-right: 0.2rem;color: #FF175D;
  }
  .tb_price label{
    margin-left: 3px;
  }
  .tb_price span{
    font-size: 0.7rem;
  }
  .tb_num {
    float: right;font-size: 0.7rem;
  }
  .aui-padded-t-10{
    padding-top:0 !important;
  }
  .tb_num_new{
    width: 100%;height: 40px;line-height: 40px;font-size: 0.7rem;margin-top: 10px;
  }
  .tb_num_new dt{
    width:75%;float: left;background: #FFEFCE;padding-left: 0.4rem;color: #634114;
  }
  .tb_num_new dt i{
    font-style: normal;margin: 0 3px;
  }
  .tb_num_new dt i::before{
    content: '￥'
  }
  .tb_num_new dd{
    width:25%;text-align: center;float: left;background: #FFEFCE;color:##634114;
  }
  .new_coupon{
    background: transparent;margin: 0;color: black;
  }
  .new_coupon .aui-huihui{
    background: transparent;
  }
  .tb_huiyui {
    float: left;
  }
  .coupon_left{
    float: left;width:70%;background: white;height: 100%;background: transparent;text-align: center;
  }
  .coupon_left dl{width: 100%}
  .coupon_left .tb_huiyui {
    width:35%;color:#ef4241;
  }
  .new_coupon .couponBox{
    padding:0;height: 4.6rem;border-radius: 5px;overflow: hidden;background:url(../image/newImg/q.png);background-size: 100% 100%;
  }
  .couponBox .quan_price{
    font-size: 1.5rem;font-weight: 700;margin-left: 3px;
  }
  .couponBox .coupon_time{
    width:65%;
  }
  .couponBox .coupon_time label{
    display: block;color:#C4C4C4;
  }
  .coupon_right{
    width:30%;height: 100%;
  }
  .ling{
    position: inherit;top:0;right: 0;text-align: center;line-height: 4.6rem;
  }
  .aui-content-padded{
    margin: 0.3rem;
  }
  .tb_zt_right .aui-content-padded{
    padding: 0.25rem;
  }
  .jL{
    width:10px;position: absolute;z-index:22;left: -5px;
  }
  .jL li{
    width:10px;height:10px;border-radius: 10px;margin: 0.3rem 0;
    background: #f5f5f5;
    /*background: red;*/
  }
  .jr{
    width:20px;height: 100%;position: absolute;z-index: 22;right:-10px;display: flex;
display: -webkit-flex;align-items:center;-webkit-align-items: center;
  }
  .jr span{
    width:20px;height: 20px;border-radius: 20px;background: #f5f5f5;display: block;
  }
  .new_shop{
    font-size: 0.8rem;
  }
  .new_shop .shopName {
    font-size: 0.8rem;height: 35px;display: flex;display: -webkit-flex;align-items:center;-webkit-align-items: center;
  }

  .new_shop img{
    width: 1.2rem;height: 1.2rem;
  }
  .shop_name{
    margin: 0 5px;
  }
  .shop_type{
    height: 20px;border-radius: 20px;padding: 0 8px;color: white;background:#ef4241;font-size: 0.7rem;line-height: 20px;letter-spacing:1px;
  }
  .shopScore{
    display: flex;display: -webkit-flex;margin: 8px 0;color:#999;
  }
  .shopScore dl{
    height: 25px;-webkit-flex:1; -webkit-box-flex: 1;font-size: 0.7rem;display: flex;display: -webkit-flex;
  }
  .shopScore dl dd{
    margin-left:5px;
  }
  .xiangq{
    background:transparent;padding: 0;width: 100%;font-size: 0.8rem;
  }
  .xihuan{
    font-size: 0.8rem;background:transparent;display: flex;display: -webkit-flex;justify-content: space-around;-webkit-justify-content: space-around;align-items:center;-webkit-align-items: center;
  }
  .youLike{
    background:transparent;
  }
  .xihuan i{
    height: 1px;width:60px;background: #ccc;
  }
  .xihuan span{
    display: -webkit-flex;align-items:center;-webkit-align-items: center;
  }
  .xihuan span img{
    width:1rem;height:1rem;margin-right: 0.3rem;
  }
  .likeImg{
    position: relative;margin: 0;
  }
  .likeImg .z_price{width:100%;position: absolute;background:rgba(0,0,0,0.4);text-align: center;left: 0;bottom:0;color: white;font-size: 0.6rem;height: 0.85rem;line-height: 0.85rem;}
  .likeImg .sharePrice{
    position: absolute;bottom:0;height: 22px;;font-size: 0.6rem;line-height: 22px;;width: 100%;background: black;color:white;text-align: center;font-style: normal;    background: #000;opacity: 0.5;
  }
  .likeImg .sharePrice i:before{
    content:"￥";font-style: normal;
  }
  #guess_list .guess_title {
    padding: 0 0.2rem;
  }
  #guess_list .guess_title .guess_icon{
    width:1rem;height:1rem;margin-right: 0.1rem
  }
  #guess_list .aui-list-item-inner{
    background: white;
  }
  .guess_title {
    display: -webkit-flex;align-items:center;-webkit-align-items: center;margin: 5px 0;
  }
  .guess_title span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;font-size: 0.8rem;color:#333;
  }
  #guess_list .tb_numbar{
    margin-top: 5px;
  }
  #guess_list .tb_zt_textbottom .tb_price_o{
    color: #8d8d8d;font-size: 0.6rem;float: left;
  }
  #guess_list .tb_num{
    font-size: 0.6rem;
  }
  .tb_price_o span{
    padding-left: 1px;text-decoration:line-through;
  }
  #guess_list .tb_price {
    display:flex;display: -webkit-flex;align-items:flex-end;-webkit-align-items: flex-end;color:#FF175D
  }
  #guess_list .tb_price span{
    text-decoration: none;font-size: 0.5rem;color: white;background: #f0392b;
    background: -webkit-linear-gradient(to left, ##FE417A 25%, ##FF4860 75%);
    background: linear-gradient(to left, ##FE417A 25%, ##FF4860 75%);border-radius: 3px;text-align: center;padding: 2px 5px;
  }
  #guess_list .tb_zt_textbottom{
    padding: 0 0.2rem 0.5rem;
  }
  #guess_list .tb_price i{
    font-size: 0.6rem;font-style: normal;
  }
  #guess_list .tb_price b{
    font-size: 0.8rem;font-style: normal;line-height: 0.8rem;
  }
  .tb_yhq{
    border: 0;height: 18px;    padding: 0 0.3rem;
    font-size: 0.6rem;    border-radius: 0;
    position: relative;    color: #fff;
    background:#FF708B;
    background: -webkit-linear-gradient(to left,#FF4860 25%, #FE417A 75%);
    background: linear-gradient(to left,#FF4860 25%, #FE417A 75%);
    border: none;
  }
  .dotr{
    position: absolute;
    width: .3rem;
    height: .3rem;
    border-radius: .3rem;
    background: #fff;
    top: 50%;
    margin-top: -.15rem;    left: -.15rem;
  }
  .dotl{
    position: absolute;
    width: .3rem;
    height: .3rem;
    border-radius: .3rem;
    background: #fff;
    top: 50%;
    margin-top: -.15rem;  right: -.15rem;
  }
  .sc {
    justify-content: center;
-webkit-justify-content: center;

align-items:center;
-webkit-align-items: center;
      -webkit-flex:1; -webkit-box-flex: 1;
  }
  .sc .collect{
    font-size: 0.8rem;margin: 0 5px;
  }
  .footer{
    display: flex;display: -webkit-flex;align-items:center;-webkit-align-items: center;
  }
  .footer .twoDiv {
      -webkit-flex:3; -webkit-box-flex: 3;  display: flex;justify-content: center;height:2rem;border-radius: 0.5rem;overflow: hidden;margin-right: 5px;border: 1px solid #FE417A;
  }
  .footer .twoDiv div{
   display: flex;display: -webkit-flex;align-items:center;-webkit-align-items: center;justify-content: center;
-webkit-justify-content: center;-webkit-flex:1; -webkit-box-flex: 1
  }
  .aui-bar-tab .aui-bar-tab-item{
    height: 2rem;
  }
  .footer .twoDiv div i{
    width:0.6rem;
  }
  .twoDiv .aui-bar-tab-item .aui-iconfont{
    font-size: 0.8rem;margin-right: 10px;
  }
  .jb img{
    width:1rem;height:1rem;margin-right: 6px;
  }
  .goTop{
    position: fixed;right: 5px;width: 2.5rem;height: 2.5rem;bottom: 5rem;z-index: 99;border-radius: 50%;color: white;text-align: center;padding-top: 0.3rem;
  }
  .hide{display: none;}

  .old_price{color: #999999;margin: 0.2rem 0;}
  .tb_zb_price .z_price{text-decoration:none;color: #FE417A;background: #FCEAEA;border-radius: 0.1rem;height: 1rem;display: inline-block;padding: 0 0.2rem;}
  .tb_num_new img{float: left;width: 1rem;margin-top: 0.3rem;margin-top: 0.4rem;margin-right: 0.2rem;}
  .aui-slide-page-active{background: #FE417A;}
  .coupon_remain_per{background: -webkit-linear-gradient(0deg,#FE417A,#FF4860); /* Safari 5.1-6.0 */
    background: -o-linear-gradient(0deg,#FE417A,#FF4860); /* Opera 11.1-12.0 */
    background: -moz-linear-gradient(0deg,#FE417A,#FF4860); /* Firefox 3.6-15 */
    background: linear-gradient(0deg,#FE417A,#FF4860); /* 标准语法 */}
  .icon_h {justify-content:center;-webkit-justify-content:center;font-size: 0.7rem;color: #333333;background: white;}
  .icon_h img{width:1rem;margin:0 0.5rem;}
  #guess_list .tb_price span{background: -webkit-linear-gradient(to left,#FF4860 25%, #FE417A 75%);
    background: linear-gradient(to left,#FF4860 25%, #FE417A 75%);}
  .foot_com img{width:1rem;display: inline-block;margin-top: 0.2rem}
  .aui-bar-tab .aui-bar-tab-label{margin-top: -0.2rem;font-size: 0.6rem;color: #999999 !important;}
  .rule{padding: 0.2rem 0.5rem;background: #FE417A;color:white;border-top-left-radius: 2rem;border-bottom-left-radius: 2rem;position: fixed;right: 0;bottom:3rem;font-size: 0.6rem;}
  .rule img{width:0.7rem;float:left;margin-top: 0.1rem;margin-right: 0.1rem}
  .aui-collapse-content{display: block;}
  .aui-card-list{margin-bottom: 0.4rem}
</style>
<body>
<div class="goTop hide" id="goTop" onClick="goTop()"><img src="../image/newImg/goTo@3x.png" alt=""></div>
<!-- 顶部end -->
<!-- 详情图片 -->
<div style="position:relative">
  <div class="back" onclick="closeWin();" style="position:absolute;"><span class="aui-iconfont aui-icon-left"></span></div>
  <div id="aui-slide3" style="height:300px;position:relative;">
      <div class="aui-slide-wrap" id="banner">
          <div class="aui-slide-node bg-dark" id="default-img">
              <img src="../image/faleimg.gif" />
          </div>
      </div>
      <div class="aui-slide-page-wrap"><!--分页容器--></div>
  </div>
</div>


<!-- 详情图片 end -->
<!-- 详情内容-->
<div class="tb_zt_right aui-card-list" >
    <div class="aui-content-padded ">
      <div class="tb_zb_price" style="height:1.5rem;">
        <div class="tb_zt_top">
          <div class="tb_price aui-padded-t-10"><span class="priceH aui-font-size-14">券后:</span><b class="aui-font-size-14" style="font-weight:500">¥<label id="price_after_quan" class="aui-font-size-20">0</label></b>
            <!-- <span class="z_price aui-font-size-10">赚￥59.9</span> -->
          </div>
          <div class="tb_num aui-list-item-right aui-padded-t-5" style="color:#999999">月销:<label id="sales">0</label></div>
        </div>
      </div>
      <div class="old_price aui-font-size-12">原价:￥<label id="price">0</label></div>
      <dl class="tb_num_new">
        <dt><img src="../image/newImg/hj.png" alt="">现在升级为总监，立奖更高佣金
        </dt>
        <dd onclick="openPublic(this)" data-frame="ccus_frm" data-title="升级会员" tapmode>立即升级</dd>
      </dl>
      <div class="tb_zt_texttop ">
          <div class="tb_zt_text">
              <div class="tb_zt_texttit aui-font-size-18" id="title" style="color:#333;font-weight:700"></div>
          </div>
      </div>
      <!-- 优惠券 -->
      <div class="aui-card-list new_coupon hide" id="coupon" tapmode onclick="buy()" style="margin:6px 0">
          <div class="aui-content-padded" style="padding:0.25rem 0;margin:0.3rem 0;">
             <div class="aui-huihui aui-card-list-header aui-card-list-user couponBox">
                <div class="aui-card-list-user-name coupon_left">
                  <dl>
                    <dt style="color:white;font-size:0.8rem;"><span id="quan_price">0</span>元优惠券</dt>
                    <dd style="color:white;font-size:0.6rem;border-left:1px dashed white;">使用期限:<label id="coupon_time"></label></dd>
                  </dl>
                </div>
                <div class="tb_num text-white ling aui-font-size-16 coupon_right">立即领取</div>
             </div>
          </div>
      </div>
    </div>
</div>


<div class="sx" style="padding: 0.75rem;background:white;margin-bottom:0.4rem;" >
  <div class="aui-list-item-inner aui-padded-t-5 hide" id="coupon_remain">
      <div class="aui-list-item-title aui-list-item-left" style="color:#333333;font-size:0.7rem;margin-bottom:0.3rem;"><img src="../image/newImg/q1.png" alt="" style="float:left;margin-right:0.2rem;width:0.9rem;margin-top:0.1rem;">优惠券剩余数量 <span id="coupon_remain_per_text"></span>张</div>
      <div class="tb_numbar" style="width:100% !important;  border-radius:20px;background:#EEEEEE;" >
      <div class="aui-progress aui-progress-sm" style="width:65% !important;  border-radius:20px;">
          <div class="aui-progress-bar coupon_remain_per" style="width:20%;  border-radius:20px;" id="coupon_remain_per"></div>
      </div>
      </div>
  </div>
</div>


<div class="aui-card-list aui-padded-5 new_shop hide" id="shop">
  <div class="aui-content-padded">
    <div class="shopName">
      <div class="tb_shop_img"><img src="../image/taobao.png" id="tb_shop"></div>
      <div class="shop_name" id="shop_name" style="color:#333333;font-weight:700;"></div>
      <!-- <div class="shop_type" id="shop_type"></div> -->
    </div>
    <div class="shopScore">
      <dl><dt>宝贝描述</dt><dd id="shop_score1">4.9</dd></dl>
      <dl><dt>卖家服务</dt><dd id="shop_score1">4.9</dd></dl>
      <dl><dt>物流服务</dt><dd id="shop_score1">4.9</dd></dl>
    </div>
  </div>


</div>

<section class="aui-content">
    <div class="aui-card-list">
      <div class="aui-card-list-header icon_h">
        <img src="../image/newImg/icon_l.png" alt="" class="icon_l">宝贝详情<img src="../image/newImg/icon_r.png" alt="" class="icon_r">
      </div>
      <div class="aui-card-list-content-padded aui-collapse-content" id="desc"></div>
    </div>
</section>

<div class="aui-card-list youLike hide" id="guess">
  <div class="aui-card-list-header icon_h" style="background:#F5F8FA;">
    <img src="../image/newImg/icon_l.png" alt="" class="icon_l">猜你喜欢<img src="../image/newImg/icon_r.png" alt="" class="icon_r">
  </div>
   <ul class="aui-content" id="guess_list">
   </ul>
</div>
<!-- 详情内容 end -->
<div class="h80"></div>
<!-- 底部按钮 -->
<footer class="aui-bar aui-bar-tab aui-margin-t-15 footer">
  <div class="aui-bar-tab-item foot_com" tapmode style="width: 4rem;color:#909090;font-size:0.7rem;" onclick="closeWin();">
      <img src="../image/newImg/list_sy.png" alt="">
      <div class="aui-bar-tab-label aui-text-default aui-font-size-12">首页</div>
  </div>
    <div class="aui-bar-tab-item foot_com" tapmode style="width: 4rem;color:#909090;font-size:0.7rem;" onclick="collect()">
        <img src="../image/newImg/list_sc.png" alt="" class="collect_icon">
        <div class="aui-bar-tab-label aui-text-default collect aui-font-size-12" data-isc='1'>收藏</div>
    </div>
    <div class="twoDiv">
      <div class="aui-bar-tab-item aui-bg-default aui-text-white" tapmode style="width: auto; background:#FE417A !important;" onclick="share()">
        <p class="text-white">分享奖<i class="earn_share">0</i></p>
      </div>
      <div class="aui-bar-tab-item aui-bg-danger aui-text-white" tapmode style="width: auto;background:white !important;color:#FE417A !important;" onclick="buy()">
        <p class="text-white" style="color:#FE417A !important;">自购省<i class="earn_zigou">0</i></p>
      </div>
    </div>
</footer>
<!-- 底部按钮 end -->
<!-- 返佣规则 -->
<!-- <div class="rule"><img src="../image/newImg/fygz.png" alt="">返佣规则</div> -->
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/aui-slide.js"></script>
<script type="text/javascript" src="../script/aui-collapse.js" ></script>
<script type="text/javascript" src="../script/zepto.min.js" ></script>
<script type="text/javascript" src="../script/doT.min.js" ></script>
<script type="text/javascript" src="../script/common.js" ></script>
<script type="text/javascript">
    var item,aliBC = null;
    var w = window.screen.height;
    apiready = function(){
        api.parseTapmode();
        aliBC = api.require("aliBC");
        //初始化
        item = api.pageParam.data;
        $('#default-img img').attr('src',item.pic||'../image/faleimg.gif');
        $('#title').html(item.title||'');
        var imgs = {"0":"../image/taobao.png","1":"../image/tmall.png","2":"../image/jd.png","3":"../image/pinduoduo.png"}
        $('#tjp-icon').attr('src',imgs[item.is_tmall||'0']);
        $('#price').html(item.price||'0');
        $('#price_after_quan').html(item.price_after_quan||'0');
        $('#sales').html(item.sales||'0');
        var quan_price = parseFloat(item.quan_price);
        if (quan_price>0) {
          $('#coupon').show();
          $('#quan_price').html(item.quan_price);
          $('#coupon_time').html(item.coupon_start_time+' - '+item.coupon_end_time);
        }
        if (parseInt(item.coupon_total_count)>0) {
          $('#coupon_remain').show();
          $('#coupon_remain_per_text').html(item.coupon_remain_count+'/'+item.coupon_total_count);
          $('#coupon_remain_per').css('width',parseInt(item.coupon_remain_count)/parseInt(item.coupon_total_count)*100+'%');
        }
        //详情
        getData(item);
        slide();
        //店铺信息
        var tjp = item.tjp||'t'
        if (tjp=='t') {
          shop_detail(item.item_id);
        }
    };
    //折叠
    var collapse = new auiCollapse({
        autoHide:false //是否自动隐藏已经展开的容器
    });
    function getData(data){
      data.collect = 0;
      _loading2();
       _Ajax(window.APIServer.ItemInfo,'post',{values:data},'json',function(ret){
            _loading2_close();
            //.渲染页面
            if (ret.code==1) {
              //是否已经收藏
              if (ret.data.is_collect==1) {
                $('.collect,.collect_icon').addClass('aui-text-warning');
                $('.collect_icon').attr("src","../image/newImg/ss.png");
                $('.collect').html('已收藏');
                // $('.collect').html('取消收藏');
                $('.collect').attr('data-isc','2');
              }
              var tjp = data.tjp||'t'
              if (tjp=='t') {
                $.get(ret.data.desc,function(res){
                    var cb = eval('res'+ret.data.desc_cb);
                    $('#desc').html(cb.replace(/src=\"\/\//g, 'src="https://'));
                },'jsonp');
                //猜你喜欢
                guess(ret.data.title);
              }else if(tjp=='j'){
                $.get(ret.data.desc,function(res){
                    var jd_json = $api.trim(res);
                    jd_json = jd_json.replace('cb'+ret.data.item_id+'(','');
                    jd_json = jd_json.substring(0, jd_json.length - 1);
                    jd_json = JSON.parse(jd_json);
                    $('#desc').html(jd_json.content.replace(/src=\"\/\//g, 'src="https://'));
                });
              }else{
                  $('#desc').html(ret.data.desc);
              }

               var banner = '';
               $(ret.data.pics).each(function(k,v){
                banner += '<div class="aui-slide-node bg-dark" id="default-img"><img class="bimg" _src="../image/faleimg.gif" src="'+v+'" /></div>';
               });
               $('#banner').html(banner);
               $('#title').html(ret.data.title);
               $('#price').html(ret.data.price)
               $('#price_after_quan').html(ret.data.price_after_quan);
               $('#sales').html(ret.data.sales);

               if (ret.data.quan_price>0) {
                $('#coupon').show();
                $('#quan_price').html(ret.data.quan_price);
                $('#coupon_time').html(ret.data.coupon_start_time+' - '+ret.data.coupon_end_time);
               }else{
                $('#coupon').hide();
               }
               if (parseInt(ret.data.coupon_total_count)>0) {
                  $('#coupon_remain').show();
                  $('#coupon_remain_per_text').html(ret.data.coupon_remain_count+'/'+ret.data.coupon_total_count);
                  $('#coupon_remain_per').css('width',parseInt(ret.data.coupon_remain_count)/parseInt(ret.data.coupon_total_count)*100+'%');
               }else{
                  $('#coupon_remain').hide();
               }
               $('.earn_share').html(ret.data.earn_share);
               $('.earn_zigou').html(ret.data.earn_zigou);
               $('.earn_sj').html(ret.data.earn_sj);
               //imageCache('.bimg');
               slide();
            }else{
                _toast(ret.msg)
            }

        })
    }
    function slide(){
      var slide3 = new auiSlide({
          container:document.getElementById("aui-slide3"),
          //"width":api.winWidth,
          "height":api.winWidth,
          "speed":500,
          "autoPlay": 3000, //自动播放
          "loop":true,
          "pageShow":true,
          'dotPosition':'center'
      })
    }
    //如果是淘宝检测是否授权
    function buy(){
      var tjp = item.tjp||'t';
      if (tjp=='t') {
        aliBC.getUserInfo(function(ret,err){
            if(ret.status){
                _Ajax(window.APIServer.BindTb,'post',{values:ret},'json',function(ret){
                    if (ret.code==1) {
                        buy2();
                    }else{
                        _toast(ret.msg)
                        aliBC.logout(function(ret,err){});//清除授权
                    }
                })
            }else{
              //登录
              aliBC.showLogin(function(ret,err){
                  if(ret.status){
                      _Ajax(window.APIServer.BindTb,'post',{values:ret},'json',function(ret){
                          if (ret.code==1) {
                              buy2();
                          }else{
                              _toast(ret.msg)
                              aliBC.logout(function(ret,err){});//清除授权
                          }
                      })
                  }else{
                      _toast('授权失败');
                  }
              });
            }
        });
      }else{
        buy2();
      }
    }
    //购买
    function buy2(){
      var tjp = item.tjp||'t';
      api.openFrame({
          name: 'plane',
          url: 'widget://html/plane.html',
          rect: {
              x: 0,
              y: 0,
              w: 'auto',
              h: 'auto'
          },
          pageParam: {tjp:tjp},
          bounces: false,
      });
      _Ajax(window.APIServer.Buy,'post',{values:item},'json',function(ret){
          api.closeFrame({
              name: 'plane'
          });
          //必须后台转链，不然这里是打不开优惠券的，使用showPageByUrl,唤起手淘
          if (ret.code==1) {
             if (tjp=='t') {
                aliBC.showPageByUrl({
                  url:ret.data.return_url,
                  openType:'native',//'auto','h5','native'
                  pid:ret.data.pid,
                  taokeAppkey:ret.data.appkey,
                  adzoneId:ret.data.adzoneid,
                },function(ret,err){
                  //购买商品的回调

                });
              }else{
                var title = "京东";
                if (tjp=='p') {title = "拼多多"}
                openWeb({"title":title,"url":ret.data.return_url});
              }
          }else{
              _toast(ret.msg)
          }

      })

    }
    //分享
    function share(){
      item.gtitle = item.title;
      item.title = '分享赚';
      item.framename = 'share_frm';
      openPublic(JSON.stringify(item))
    }
    //收藏与取消
    function collect(){
      var isc = $('.collect').data('isc');
      item.collect = isc||1;
      console.log(JSON.stringify(item))
      _Ajax(window.APIServer.ItemInfo,'post',{values:item},'json',function(ret){
            //.渲染页面
            if (ret.code==1) {
              if (isc==1) {
                $('.collect,.collect_icon').addClass('aui-text-warning')
                $('.collect_icon').attr("src","../image/newImg/ss.png");
                $('.collect').html('已收藏');
                $('.collect').attr('data-isc','2');
              }else{
                $('.collect,.collect_icon').removeClass('aui-text-warning')
                $('.collect_icon').attr("src","../image/newImg/list_sc.png");
                $('.collect').html('收藏');
                $('.collect').attr('data-isc','1');
              }

            }else{
                _toast(ret.msg)
            }

        })
    }
    //猜你喜欢，拿当前的标题搜一下
    function guess(q){
        _Ajax(window.APIServer.Search,'post',{values:{tjp:'t',q:q,is_quan:'true'}},'json',function(ret){
            _loading2_close();
            //.渲染页面
            if (ret.code==1) {
               var evalText = doT.template($api.text($api.byId('goodslist')));
               $api.html($api.byId('guess_list'), evalText(ret.data));
               $('#guess').show();
               imageCache('.goods_img');
            }else if(ret.code==2){
               $('#list').html('<div class="loading-1">'+ret.msg+'</div>');
            }else{
                p--;
                $('body').append('<div class="loading-1">'+ret.msg+'</div>');
            }

        })
    }

    //店铺详情
    function shop_detail(item_id){
      var url = 'https://acs.m.taobao.com/h5/mtop.taobao.detail.getdetail/6.0/?data=';
      url = url + encodeURIComponent('{"itemNumId":"'+item_id+'"}');
      $.get(url,function(ret){
        console.log(JSON.stringify(ret))
        var seller = ret.data.seller;
        if (seller!==undefined) {
          $('#tb_shop').attr('src','https:'+seller.shopIcon);
          $('#shop_name').text(seller.shopName);
          $('#shop_type').text(item.is_tmall==0?'淘宝':'天猫');
          var shopScore = '';
          $(seller.evaluates).each(function(k,v){
            shopScore += '<dl><dt>'+v.title+'</dt><dd>'+v.score+'</dd></dl>';
          });
          $('.shopScore').html(shopScore);
          $('#shop').show();
        }
      },'jsonp');
    }
    // 监听滚动条
    window.onscroll= function(){
      var h =$(window).scrollTop();
      //console.log(h)
      if(h>=(w-300)){
      $("#goTop").removeClass("hide");
      }else if(h == 0){
      $("#goTop").addClass("hide");
      }

    }
    // 返回顶部
    function goTop(){
      $("body").scrollTop(0)
    }

</script>
<script id="goodslist" type="text/x-dot-template">
  {{ for (key in it.data){ }}
  {{ var param=it['data'][key];param.win_name = 'guess'+'_'+it['data'][key]['item_id']; }}
  <li class="aui-list-item aui-col-xs-6 aui-padded-5" onclick='open_goods({{= JSON.stringify(param) }})' tapmode style="background:#F5F8FA;">
    <div class="aui-list-item-inner">
      <div class="aui-row aui-row-padded likeImg">
        <img class="goods_img" src="../image/faleimg.gif" _src="{{= it['data'][key]['pic'] }}">
        <div class="z_price">分享奖￥{{= it['data'][key]['earn_yg'] }}</div>
      </div>
      <div class="aui-list-item-title aui-padded-t-10 guess_title"><span>{{= it['data'][key]['short_title'] }}</span> </div>
      <div class="tb_zt_textbottom">
        <div class="tb_zt_top">
          <div class="tb_price_o">原价:¥<span>{{= it['data'][key]['price'] }}</span></div>
          <div class="tb_num">{{= it['data'][key]['sales'] }}人已买</div>
        </div>
          <div class="tb_numbar">
            <div class="tb_price"><span>券后价</span><i>￥</i><b>{{= it['data'][key]['price_after_quan'] }}</b></div>
            <div class="tb_yhq">{{= it['data'][key]['quan_price'] }}元券
              <div class="dotl"></div><div class="dotr"></div>
            </div>
          </div>
      </div>
    </div>
  </li>
  {{ } }}
</script>
</html>
